//导入request.js请求工具
import request from "@/utils/request.js";

//提供调用分类列表的函数
export const cateListService = () => {
  return request.get("/category/list");
};

//提供调用一级分类数据的函数
export const cateFirstService = (query) => {
  return request.get("/category/first", { params: query });
};

//提供调用二级分类数据的函数
export const cateSecondService = (query) => {
  return request.get("/category/second", { params: query });
};

//提供调用三级分类数据的函数
export const cateThirdService = (query) => {
  return request.get("/category/third", { params: query });
};

//提供添加分类的函数
export const cateAddService=(formData)=>{
  return request.post("/category",formData)
}

//提供获取分类详情的函数
export const cateDetailService=(type,id)=>{
  return request.get(`/category/detail/${type}/${id}`)
}


//提供修改分类的函数
export const cateUpdateService=(formData)=>{
  return request.put("/category",formData)
}


//提供删除分类的函数
export const cateDeleteService=(type,id)=>{
  return request.delete(`/category/${type}/${id}`)
}